treemodelfilter: rework reference counting
authorKristian Rietveld <kris@gtk.org>
Sun, 10 Jul 2011 14:35:38 +0000 (16:35 +0200)
committerKristian Rietveld <kris@gtk.org>
Mon, 22 Aug 2011 19:30:32 +0000 (21:30 +0200)
commit88dd6372b0db170b4eefff42e8e5e8ccd4127f6c
treefca9c88b405e4c575d4236f643e36b927fba5850
parent2984e22ef0b95e23656b1adc502070ef0d104acb
treemodelfilter: rework reference counting

 - Before we kept a reference on all nodes in non-root levels.  This has
   been changed, now we keep a reference on the first node of each level.
   If, due to changes in the model, another node becomes the first node in
   the level, the reference is transferred to this new first node.
 - All non-root levels keep a reference on their parent.
 - By making use of the external ref count, the filter model now emits less
   unnecessary signals.
 - GtkTreeModelFilter does support filter functions which decide visibility
   of a given node based on the number of or visibility of children.
   To accomplish this, a child level of a node is cached when its
   parent has an external ref count > 0, because changes to the node might
   affect this parent.
 - An optimization for not building the root level in case the inserted
   node is not visible in gtk_tree_model_filter_row_inserted() has been
   removed.  In this case, we still need to build the root level and
   possibly a child level to monitor for signals which might make
   this row visible.
gtk/gtktreemodelfilter.c